import {postForm, service} from '@/common/utils/request'
import {parseGetParam} from "@/common/utils/kit";

const JLDZ = '/manage/jldz'
const JLDZJW = '/manage/jldz/jw'

export function ddUpload(param = {}) {
    return postForm(`${JLDZ}/ddUpload`, param)
}

export function bmCreateJsZip(param = {}) {
    return postForm(`${JLDZ}/bmCreateJsZip`, param)
}

export function jwCreateJsZip(param = {}) {
    return postForm(`${JLDZ}/jwCreateJsZip`, param)
}

export function jwCreateTaskZip(param = {}) {
    return postForm(`${JLDZ}/jwCreateTaskZip`, param)
}

export function bmJsPageZip(param = {}) {
    return postForm(`${JLDZ}/bmJsPageZip`, param)
}

export function jwJsPageZip(param = {}) {
    return postForm(`${JLDZ}/jwJsPageZip`, param)
}

export function jwTaskPageZip(param = {}) {
    return postForm(`${JLDZ}/jwTaskPageZip`, param)
}


//课程任务
export function selectJsTeacherCourse(param = {}) {
    return postForm(`${JLDZ}/js/course`, param)
}

//课程任务
export function selectBmTeacherCourse(param = {}) {
    return postForm(`${JLDZ}/bm/course`, param)
}

//课程任务
export function selectJwTeacherCourse(param = {}) {
    return postForm(`${JLDZ}/jw/course`, param)
}


//课程任务
export function selectTeacherCourse(param = {}) {
    return postForm(`${JLDZ}/js/course`, param)
}

//课程任务文件
export function selectJsCourseFile(param = {}) {
    return postForm(`${JLDZ}/js/courseFile`, param)
}

//课程任务文件
export function selectBmCourseFile(param = {}) {
    return postForm(`${JLDZ}/bm/courseFile`, param)
}

//课程任务文件
export function selectJwCourseFile(param = {}) {
    return postForm(`${JLDZ}/jw/courseFile`, param)
}

//课程任务文件
export function selectJsTaskFile(param = {}) {
    return postForm(`${JLDZ}/jsTaskFile`, param)
}

//课程任务文件
export function selectBmTaskFile(param = {}) {
    return postForm(`${JLDZ}/bmTaskFile`, param)
}

//课程任务文件
export function selectJwTaskFile(param = {}) {
    return postForm(`${JLDZ}/jwTaskFile`, param)
}

//删除课程任务文件
export function deleteTeacherCourseFile(param = {}) {
    return postForm(`${JLDZ}/js/deleteFile`, param)
}

//删除课程任务文件
export function jwDeleteZipFile(param = {}) {
    return postForm(`${JLDZ}/jwDeleteZipFile`, param)
}

//删除课程任务文件
export function bmDeleteZipFile(param = {}) {
    return postForm(`${JLDZ}/bmDeleteZipFile`, param)
}

//课程教务处任务
export function selectTeacherTask(param = {}) {
    return postForm(`${JLDZ}/js/task`, param)
}

//教务处：教务处任务分页查询
export function jsPageTask(param = {}) {
    return postForm(`${JLDZ}/js/pageTask`, param)
}

//教务处：教务处任务分页查询
export function bmPageTask(param = {}) {
    return postForm(`${JLDZ}/bm/pageTask`, param)
}

//教务处：教务处任务分页查询
export function jwPageTask(param = {}) {
    return postForm(`${JLDZ}/jw/pageTask`, param)
}

//教务处：教务处添加任务
export function jwAddTask(param = {}) {
    return postForm(`${JLDZJW}/addTask`, param)
}

//教务处：教务处修改任务
export function jwUpdateTask(param = {}) {
    return postForm(`${JLDZJW}/updateTask`, param)
}

//教务处：教务处关闭任务
export function jwUpdateTaskStatus(param = {}) {
    return postForm(`${JLDZJW}/updateTaskStatus`, param)
}

//教务处：教务处删除任务
export function jwDelTask(param = {}) {
    return postForm(`${JLDZJW}/delTask`, param)
}

//教务处：
export function jwDownloadZip(param) {
    return service.get(`${JLDZ}/jw/downloadZip` + parseGetParam(param, "?",),
        {
            responseType: 'blob',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'}
        });
}

//教务处：
export function bmDownloadZip(param) {
    return service.get(`${JLDZ}/bm/downloadZip` + parseGetParam(param, "?",),
        {
            responseType: 'blob',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'}
        });
}







